package com.zhts.oa.department.controller;


import com.zhts.oa.common.ResultModel;
import com.zhts.oa.department.entity.DeptTree;
import com.zhts.oa.department.service.impl.DepartmentServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author jobob
 * @since 2020-12-10
 */
@RestController
@RequestMapping("/department/department")
public class DepartmentController {

    @Autowired
    private DepartmentServiceImpl departmentService;

    @GetMapping()
    public ResultModel<List<DeptTree>> deptlist(){
        List<DeptTree> tree = departmentService.getTree();
        return ResultModel.success(tree);
    }
}

